public class EetendsDemo06 {
    public static void main(String[] args) {
        Cat cat = new Cat();
        cat.age = 8;
        cat.color = "红色";
        cat.eat();

        Dog dog = new Dog();
        dog.age = 10;
        dog.color = "黑色";
        dog.eat();
    }
}


// 动物类
class Animal {
    public String color;
    public int age;

    public void eat() {
        System.out.println("吃");
    }
}

class Cat extends Animal {

}

class Dog extends Animal {

}
